package mollmapsgenerator;


import java.util.ArrayList;
import java.util.List;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author hanis
 */
public class RecordsColection {

    private String signature;
    private List<Record> recordList;
    private List<String> urlList;
    private Record mainRecord;

    public RecordsColection() {
    }

    public RecordsColection(String signature) {
        this.signature = signature;
    }

    /**
     * @return the signature
     */
    public String getSignature() {
        return signature;
    }

    /**
     * @param signature the signature to set
     */
    public void setSignature(String signature) {
        this.signature = signature;
    }

    public void addSysno(Record sysno) {
        if (getRecordList() == null) {
            this.setRecordList(new ArrayList<Record>());
        }
        this.getRecordList().add(sysno);
    }

    public void addUrl(String url) {
        if (getUrlList() == null) {
            this.setUrlList(new ArrayList<String>());
        }
        this.getUrlList().add(url);
    }

    /**
     * @return the recordList
     */
    public List<Record> getRecordList() {
        return recordList;
    }

    /**
     * @param recordList the recordList to set
     */
    public void setRecordList(List<Record> recordList) {
        this.recordList = recordList;
    }

    /**
     * @return the urlList
     */
    public List<String> getUrlList() {
        return urlList;
    }

    /**
     * @param urlList the urlList to set
     */
    public void setUrlList(List<String> urlList) {
        this.urlList = urlList;
    }

    /**
     * @return the mainRecord
     */
    public Record getMainRecord() {
        return mainRecord;
    }

    /**
     * @param mainRecord the mainRecord to set
     */
    public void setMainRecord(Record mainRecord) {
        addSysno(mainRecord);
        this.mainRecord = mainRecord;
    }


    public boolean equals(Object obj) {
        if(obj == null) {
            return false;
        }
        if(obj instanceof RecordsColection) {
            RecordsColection r = (RecordsColection) obj;
            if(r.getMainRecord().equals(getMainRecord())) {
                return true;
            }
        }
        return false;
    }



    public static void main(String[] args) {
        String a = "Moll-0090.900,AA.T.XIV";
        System.out.println(a.substring(19));
         
    }

}
